package com.edu.springboot;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

// 自动配置
@SpringBootApplication
public class Springboot01DemoApplication {

    public static void main(String[] args) {

//		SpringApplication.run(Springboot01DemoApplication.class, args);

//        // 创建SpringApplication对象
//        SpringApplication springApplication = new SpringApplication(Springboot01DemoApplication.class);
//        // 关闭banner
//        springApplication.setBannerMode(Banner.Mode.OFF);
//        // 设置监听器
////		springApplication.setListeners();
//
//        // 运行
//        springApplication.run(args);

        // 链式启用
        SpringApplicationBuilder springApplicationBuilder = new SpringApplicationBuilder(Springboot01DemoApplication.class);
        springApplicationBuilder
//                .sources(Springboot01DemoApplication.class)
                .bannerMode(Banner.Mode.OFF)
                .environment(null)
                .run(args);
    }

}
